#pragma once

#ifndef _Water_h_
#define _Water_h_

#include "../../Framework/Mesh.h"
#include "../../Framework/Vertex.h"

#include <d3dx9math.h>

namespace MyGame {

using namespace Framework;

class Water :
            public Mesh {
public:
    Water(Game* game, FLOAT height, int width, int length);
    virtual ~Water(void);
    FLOAT GetHeight() const;
    int GetLength() const;
    int GetWidth() const;
    IDirect3DTexture9* GetReflectionTexture() const;
    void SetReflectionTexture(IDirect3DTexture9* val);
    virtual void Draw(FLOAT timeDelta);
    virtual void Initialize();
    virtual void LoadContent();
private:
    FLOAT height;
    int length;
    int width;
    IDirect3DTexture9* reflectionTexture;
    IDirect3DVolumeTexture9* textureWater;
    void GenerateIndices(DWORD* indices);
    void GenerateModel();
    void GenerateVertices(Vertex* vertices);
};

}

#endif
